home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / c / resolver.man < prev    next >
Encoding:
Text File  |  1990-07-27  |  7.1 KB  |  199 lines

  1.  
  2.  
  3.  
  4. RESOLVER              C Library Procedures               RESOLVER
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      res_mkquery, res_send, res_init, dn_comp, dn_expand -
  10.      resolver routines
  11.  
  12. SSYYNNOOPPSSIISS
  13.      ##iinncclluuddee <<ssyyss//ttyyppeess..hh>>
  14.      ##iinncclluuddee <<nneettiinneett//iinn..hh>>
  15.      ##iinncclluuddee <<aarrppaa//nnaammeesseerr..hh>>
  16.      ##iinncclluuddee <<rreessoollvv..hh>>
  17.  
  18.      rreess__mmkkqquueerryy((oopp,, ddnnaammee,, ccllaassss,, ttyyppee,, ddaattaa,, ddaattaalleenn,, nneewwrrrr,,
  19.      bbuuff,, bbuufflleenn))
  20.      iinntt oopp;;
  21.      cchhaarr **ddnnaammee;;
  22.      iinntt ccllaassss,, ttyyppee;;
  23.      cchhaarr **ddaattaa;;
  24.      iinntt ddaattaalleenn;;
  25.      ssttrruucctt rrrreecc **nneewwrrrr;;
  26.      cchhaarr **bbuuff;;
  27.      iinntt bbuufflleenn;;
  28.  
  29.      rreess__sseenndd((mmssgg,, mmssgglleenn,, aannsswweerr,, aannsslleenn))
  30.      cchhaarr **mmssgg;;
  31.      iinntt mmssgglleenn;;
  32.      cchhaarr **aannsswweerr;;
  33.      iinntt aannsslleenn;;
  34.  
  35.      rreess__iinniitt(())
  36.  
  37.      ddnn__ccoommpp((eexxpp__ddnn,, ccoommpp__ddnn,, lleennggtthh,, ddnnppttrrss,, llaassttddnnppttrr))
  38.      cchhaarr **eexxpp__ddnn,, **ccoommpp__ddnn;;
  39.      iinntt lleennggtthh;;
  40.      cchhaarr ****ddnnppttrrss,, ****llaassttddnnppttrr;;
  41.  
  42.      ddnn__eexxppaanndd((mmssgg,, eeoommoorriigg,, ccoommpp__ddnn,, eexxpp__ddnn,, lleennggtthh))
  43.      cchhaarr **mmssgg,, **eeoommoorriigg,, **ccoommpp__ddnn,, eexxpp__ddnn;;
  44.      iinntt lleennggtthh;;
  45.  
  46. DDEESSCCRRIIPPTTIIOONN
  47.      These routines are used for making, sending and interpreting
  48.      packets for use with Internet domain name servers.  Global
  49.      information that is used by the resolver routines is kept in
  50.      the variable __r_e_s.  Most of the values have reasonable
  51.      defaults and can be ignored.  Options stored in __r_e_s._o_p_t_i_o_n_s
  52.      are defined in _r_e_s_o_l_v._h and are as follows.  Options are
  53.      stored a simple bit mask containing the bitwise ``or'' of
  54.      the options enabled.
  55.  
  56.      RES_INIT
  57.           True if the initial name server address and default
  58.           domain name are initialized (i.e., _r_e_s__i_n_i_t has been
  59.           called).
  60.  
  61.  
  62.  
  63. Sprite v1.0             November 21, 1987                       1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. RESOLVER              C Library Procedures               RESOLVER
  71.  
  72.  
  73.  
  74.      RES_DEBUG
  75.           Print debugging messages.
  76.  
  77.      RES_AAONLY
  78.           Accept authoritative answers only.  With this option,
  79.           _r_e_s__s_e_n_d should continue until it finds an authorita-
  80.           tive answer or finds an error.  Currently this is not
  81.           implemented.
  82.  
  83.      RES_USEVC
  84.           Use TCP connections for queries instead of UDP
  85.           datagrams.
  86.  
  87.      RES_STAYOPEN
  88.           Used with RES_USEVC to keep the TCP connection open
  89.           between queries.  This is useful only in programs that
  90.           regularly do many queries.  UDP should be the normal
  91.           mode used.
  92.  
  93.      RES_IGNTC
  94.           Unused currently (ignore truncation errors, i.e., don't
  95.           retry with TCP).
  96.  
  97.      RES_RECURSE
  98.           Set the recursion-desired bit in queries.  This is the
  99.           default.  ( _r_e_s__s_e_n_d does not do iterative queries and
  100.           expects the name server to handle recursion.)
  101.  
  102.      RES_DEFNAMES
  103.           If set, _r_e_s__m_k_q_u_e_r_y will append the default domain name
  104.           to single-component names (those that do not contain a
  105.           dot).  This is the default.
  106.  
  107.      RES_DNSRCH
  108.           If this option is set, the standard host lookup routine
  109.           _g_e_t_h_o_s_t_b_y_n_a_m_e(3) will search for host names in the
  110.           current domain and in parent domains; see _h_o_s_t_n_a_m_e(7).
  111.  
  112.      _R_e_s__i_n_i_t
  113.  
  114.      reads the initialization file to get the default domain name
  115.      and the Internet address of the initial hosts running the
  116.      name server.  If this line does not exist, the host running
  117.      the resolver is tried.  _R_e_s__m_k_q_u_e_r_y makes a standard query
  118.      message and places it in _b_u_f.  _R_e_s__m_k_q_u_e_r_y will return the
  119.      size of the query or -1 if the query is larger than _b_u_f_l_e_n.
  120.      _O_p is usually QUERY but can be any of the query types
  121.      defined in _n_a_m_e_s_e_r._h.  _D_n_a_m_e is the domain name.  If _d_n_a_m_e
  122.      consists of a single label and the RES_DEFNAMES flag is
  123.      enabled (the default), the current domain name will be
  124.      appended to _d_n_a_m_e.  The current domain name is defined by
  125.      the hostname or is specified in a system file; it can be
  126.  
  127.  
  128.  
  129. Sprite v1.0             November 21, 1987                       2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. RESOLVER              C Library Procedures               RESOLVER
  137.  
  138.  
  139.  
  140.      overridden by the environment variable LOCALDOMAIN.  _N_e_w_r_r
  141.      is currently unused but is intended for making update mes-
  142.      sages.
  143.  
  144.      _R_e_s__s_e_n_d sends a query to name servers and returns an
  145.      answer.  It will call _r_e_s__i_n_i_t if RES_INIT is not set, send
  146.      the query to the local name server, and handle timeouts and
  147.      retries.  The length of the message is returned, or -1 if
  148.      there were errors.
  149.  
  150.      _D_n__e_x_p_a_n_d expands the compressed domain name _c_o_m_p__d_n to a
  151.      full domain name.  Expanded names are converted to upper
  152.      case.  _M_s_g is a pointer to the beginning of the message,
  153.      _e_x_p__d_n is a pointer to a buffer of size _l_e_n_g_t_h for the
  154.      result.  The size of compressed name is returned or -1 if
  155.      there was an error.
  156.  
  157.      _D_n__c_o_m_p compresses the domain name _e_x_p__d_n and stores it in
  158.      _c_o_m_p__d_n.  The size of the compressed name is returned or -1
  159.      if there were errors.  _l_e_n_g_t_h _i_s _t_h_e _s_i_z_e _o_f _t_h_e _c_o_m_p__d_n.
  160.      _D_n_p_t_r_s is a list of pointers to previously compressed names
  161.      in the current message.  The first pointer points to to the
  162.      beginning of the message and the list ends with NULL.
  163.      _l_a_s_t_d_n_p_t_r is a pointer to the end of the array pointed to
  164.      _d_n_p_t_r_s.  A side effect is to update the list of pointers for
  165.      labels inserted into the message by _d_n__c_o_m_p as the name is
  166.      compressed.  If _d_n_p_t_r is NULL, names are not compressed.  If
  167.      _l_a_s_t_d_n_p_t_r is NULL, the list of labels is not updated.
  168.  
  169. FFIILLEESS
  170.      /etc/resolv.conf    see resolver(5)
  171.  
  172. SSEEEE AALLSSOO
  173.      gethostbyname(3), named(8), resolver(5), hostname(7),
  174.      RFC882, RFC883, RFC973, RFC974,
  175.      SMM:11 Name Server Operations Guide for BIND
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195. Sprite v1.0             November 21, 1987                       3
  196.  
  197.  
  198.  
  199.